package com.example.downloaddemo;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by xiewei on 15-2-3.
 */
public class DBHelper extends SQLiteOpenHelper {
	public DBHelper(Context context) {
		super(context, "download.db", null, 1);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL("create table download_info (_id integer  PRIMARY KEY AUTOINCREMENT, " +
				"thread_id integer,start_pos integer, end_pos integer, complete_size integer,url char)");
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL("DROP TABLE IF EXISTS download_info");
	}
}
